<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title>areaDetector Plugin NDFileNexus</title>
  <meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type" />
</head>
<body>
  <div style="text-align: center">
    <h1>
      areaDetector Plugin NDFileNexus</h1>
    <h2>
      October 7, 2014</h2>
    <h2>
      Mark Rivers</h2>
    <h2>
      University of Chicago</h2>
  </div>
  <p>
    A plugin to write <a href="http://www.nexusformat.org/Main_Page">NeXus</a> files
    was written by John Hammonds from the APS. NeXus is a standard format for x-ray
    and neutron data based on <a href="http://www.hdfgroup.org">HDF</a>. This is a very
    general file format, capable of storing any type of array data and meta-data.</p>
  <p>
    The <a href="areaDetectorDoxygenHTML/class_n_d_file_nexus.html">NDFileNexus class
      documentation </a>describes this class in detail.
  </p>
  <p>
    The NDFileNexus plugin is created with the NDFileNexusConfigure command, either
    from C/C++ or from the EPICS IOC shell.</p>
  <pre>NDFileNexusConfigure (const char *portName, int queueSize, int blockingCallbacks, 
                      const char *NDArrayPort, int NDArrayAddr, size_t maxMemory, 
                      int priority, int stackSize)
  </pre>
  <p>
    For details on the meaning of the parameters to this function refer to the detailed
    documentation on the NDFileNexusConfigure function in the <a href="areaDetectorDoxygenHTML/_n_d_file_nexus_8cpp.html">
      NDFileNexus.cpp documentation</a> and in the documentation for the constructor
    for the <a href="areaDetectorDoxygenHTML/class_n_d_file_nexus.html">NDFileNexus class</a>.</p>
  <p>
    NDFileNeXus uses 2 additional parameters to define the location of an XML file that
    is read to determine the contents of the NeXus files written by this plugin. These
    are described in the following table.</p>
  <table border="1" cellpadding="2" cellspacing="2" style="text-align: left">
    <tbody>
      <tr>
        <td align="center" colspan="7,">
          <b>Parameter Definitions in NDFileNexus.h and EPICS Record Definitions in NDFileNexus.template</b>
        </td>
      </tr>
      <tr>
        <th>
          Parameter index variable</th>
        <th>
          asyn interface</th>
        <th>
          Access</th>
        <th>
          Description</th>
        <th>
          drvInfo string</th>
        <th>
          EPICS record name</th>
        <th>
          EPICS record type</th>
      </tr>
      <tr>
        <td align="center" colspan="7,">
          <b>Location of XML file to configure NeXus file contents</b></td>
      </tr>
      <tr>
        <td>
          NDFileNexusTemplatePath</td>
        <td>
          asynOctet</td>
        <td>
          r/w</td>
        <td>
          Path to XML template file</td>
        <td>
          TEMPLATE_FILE_PATH</td>
        <td>
          $(P)$(R)TemplateFilePath<br />
          $(P)$(R)TemplateFilePath_RBV</td>
        <td>
          waveform<br />
          waveform</td>
      </tr>
      <tr>
        <td>
          NDFileNexusTemplateFile</td>
        <td>
          asynOctet</td>
        <td>
          r/w</td>
        <td>
          Name of XML template file</td>
        <td>
          TEMPLATE_FILE_NAME</td>
        <td>
          $(P)$(R)TemplateFileName<br />
          $(P)$(R)TemplateFileName_RBV</td>
        <td>
          waveform<br />
          waveform</td>
      </tr>
    </tbody>
  </table>
  <p>
    There is currently no documentation on the contents of the XML template file. However,
    there are example XML template files in the iocSimDetector and iocPerkinElmer directories.
    Documentation on the XML file contents will be written ASAP.
    <!-- TODO: Document the XML template file contents-->
    It is possible to validate most of the syntax in a NeXus template XML file. For
    example, the command (starting from the <tt>iocBoot</tt> directory) to validate
    the syntax of the <tt>iocBoot/iocSimDetector/NexusTemplate.xml</tt> file is:</p>
  <pre>xmllint --noout --schematron ./template.sch iocSimDetector/NexusTemplate.xml</pre>
  <p>
    The prebuilt Linux libraries libhdf5.a and libNeXus.a are built with HDF5 1.6.9.
    When they are built with the latest version, 1.8.2, they require GLIBC version 2.7
    or higher, i.e. /lib/libc-2.7.so or higher. Since users may want to install areaDetector
    on older Linux systems (which predate Fedora Core 8 for example), it was decided
    to use this older version of HDF5. Future releases of areaDetector may use HDF5
    1.8.2 or later, and hence not work with older Linux systems.</p>
  <div style="text-align: center">
    <h3>
      NDFileNexus.adl</h3>
    <p>
      <img alt="NDFileNexus.png" src="NDFileNexus.png" /></p>
  </div>
</body>
</html>
